package com.dl.dlcommon.utils.result;

import lombok.Getter;
import lombok.ToString;

/**
 * 响应结果状态码
 * @author DL
 * @create 2024/04/07
 */
@Getter
@ToString
public enum ResultCodeEnum {

    /*登录注册类*/
    SUCCESS(true, 200, "成功"),
    SUCCESS_REGISTER(true,200,"注册成功!"),
    SUCCESS_LOGIN(true,200,"登陆成功!"),
    ACCOUNT_LOCKOUT(false,400,"账号锁定，请联系管理员解锁！"),
    ACCOUNT_ERROR(false,400,"账户或密码错误！"),
    CAPTCHA_ERROR(false,400,"验证码错误！！"),

    /*token*/
    TOKENS_SIGNATURE_EXCEPTION(false, 403, "token签名异常"),
    TOKENS_EXPIRE_EXCEPTION(false, 403, "token过期异常"),
    TOKENS_MISMATCH_EXCEPTION(false, 403, "token算法不匹配异常"),
    TOKENS_INVALID_EXCEPTION(false, 403, "token无效"),

    BAD_SQL_GRAMMAR(false,21001,"sql语法错误"),
    JSON_PARSE_ERROR(false,21002,"json解析异常"),
    PARAM_ERROR(false,21003,"参数不正确"),
    FILE_UPLOAD_ERROR(false,21004,"文件上传错误"),
    EXCEL_DATA_IMPORT_ERROR(false,21005,"Excel数据导入错误"),
    ERROR_AUTH_CODE(false,21006,"验证码错误!"),
    ERROR_NOT_EXISTS_USER(false,21007,"用户不存在!"),
    ERROR_PASSWORD(false,21008,"密码错误,请重新输入!"),
    UNKNOWN_REASON(false,20001,"未知错误");

    private final Boolean success;

    private final Integer code;

    private final String data;

    ResultCodeEnum(Boolean success, Integer code, String data) {
        this.success = success;
        this.code = code;
        this.data = data;
    }
}

